package com.tandashi.springbootstudy01.entity.user;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    private static final long serialVersionUID = -4815161884505922803L;

    private Long id;
    private String username;
    private String password;
    private Integer userType;
    private String realname;
    private Integer certiType;
    private String certiNo;
    private Integer status;
    private String phone;
    private String email;
    private String province;
    private String city;

    private Long agentId;
    private String agentOfflineCode;
    private String agentOrganId;
    private String agentOrganFullId;
    private String agentCategory;
    private LocalDate agentEnterCompanyDate;

    private LocalDateTime registerTime;

    private Integer sourcePlatform;

    public String toString1() {
        StringBuilder builder = new StringBuilder();
        builder.append("User {");
        if(id != null)
            builder.append("id=").append(id).append(", ");
        if(username != null)
            builder.append("username=").append(username).append(", ");
        builder.append("}");
        return builder.toString();
    }

    public User(Long id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }
}
